package com.pty.demo.structural.decorator;

import java.math.BigDecimal;

/**
 * @author pengty
 * @date 2020/3/12
 */
public class AppleDecorator extends AbstractFruitDecorator {


    public AppleDecorator(CakeComponent cakeComponent) {
        super(cakeComponent);
    }

    @Override
    public BigDecimal price() {
        return cakeComponent.price().add(BigDecimal.valueOf(40));
    }

    @Override
    public String name() {
        return cakeComponent.name() + " 加苹果";
    }
}
